<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import Cookies from 'js-cookie'
export default {
  name: 'App',
  created(){
    // let code = this.GetUrlParam('code')
    //   if (code == null || code === '') {
    //   window.location.href ='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx35c30715baeb97e7&redirect_uri=http://flrjwx.51vip.biz/back/index.html&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect'
    // } else {
    //     this.$axios.post("http://flrjwx.51vip.biz/intercept/thirdparty/wx/redirect/getopenid?code="+code).then((res) => {
    //       console.log(res)
    //         alert(JSON.stringify(res.data))
    //         alert(JSON.stringify(res.data.sysparams))
    //         alert(res.data.sysparams.usermessage.fopenid)
    //         Cookies.set('fnickname',res.data.sysparams.usermessage.fnickname)
    //         Cookies.set('fopenid',res.data.sysparams.usermessage.fopenid)
    //         Cookies.set('fusreid',res.data.sysparams.usermessage.fusreid)
    //         Cookies.set('fusrename',res.data.sysparams.usermessage.fusrename)
    //         Cookies.set('headimgurl',res.data.sysparams.usermessage.headimgurl)
    //   }).catch(() => {

    //   })
    // }


  },
   methods: {
           GetUrlParam(name){
          var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
          var r = window.location.search.substr(1).match(reg);
          if (r != null) return unescape(r[2]); return null;
        }
   }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  text-align: center
}
*{
  margin:0;
  padding:0
}
html, body, #app {
  height: 100%;
}
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}
.main {
  position: relative;
  min-height: 100%;
  padding: 46px 0 50px;
  box-sizing: border-box;
  text-align: left
}
.van-nav-bar__title {
  font-weight: bold;
}
</style>
